package com.open.capacity.notice.provider.sms;

import java.io.IOException;
import java.util.function.Consumer;

import com.open.capacity.notice.provider.sms.interactive.req.SendSmsRequest;
import com.open.capacity.notice.provider.sms.interactive.res.SendSmsResponse;

/**
 * 短信异步请求
 *
 */
public class AsyncSmsOperations extends SmsOperations {
	public AsyncSmsOperations(SmsTemplate smsTemplate) {
		super(smsTemplate);
	}
	/**
	 * 短信文本发送
	 * @param sendSmsRequest
	 * @param success
	 * @param failure
	 * @throws IOException
	 */
	public void sendText(SendSmsRequest sendSmsRequest, Consumer<SendSmsResponse> success,
			Consumer<IOException> failure) throws IOException {
		super.asyncGet(SmsApiAddress.SEND_SMS, false, sendSmsRequest, SendSmsResponse.class, success, failure,
				smsTemplate.getSmsProperties().getHost());
	}

}
